/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package wc;

import java.util.ArrayList;

/**
 *
 * @author Administrator
 */
public class Read {	//将string类型的字符串转换成ArrayList<String>类型
    public ArrayList<String> readfile(String line){
	ArrayList<String> arrylist=new ArrayList<>();
	String[] everyword = line.split("\n");//用空格作为分割
    System.out.println("everyword.length_"+everyword.length);
    String str;
       for(int j=0;j<everyword.length;j++){
           arrylist.add(everyword[j]);//添加到ArrayList<String>类型数组
       }
        
    System.out.println(arrylist);
     
                
		return arrylist;
	}
}
